package com.xxxx.server.util;

import com.xxxx.server.pojo.Admin;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @description: 操作员工具类
 * @author: Wy
 * @create: 2021-11-25 10:43
 **/
public class AdminUtil {

    /**
     * 获取当前操作员
     */
    public static Admin getCurrentAdmin(){
        return ((Admin) SecurityContextHolder.getContext().getAuthentication().getPrincipal());
    }
}
